<!--设置模块唯一ID-->
<div id="zb_yewumingxi_modify">
<!--标题、面包屑-->
<section class="content-header">
    <h1>
        业务明细
        <small>租摆</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li>租摆</li>
        <li>业务明细</li>
        <li class="active">修改业务明细</li>
    </ol>
</section>
<!--列表-->
<section class="content">

</section>
<!--添加、修改弹出层-->
<script type="text/template" data-for="tp_editor">
        <form role="form" class="form-horizontal">
            <div class="u-area">
                <div class="form-group">
                    <label class="col-sm-2 control-label">编号：<%=data.p1?data.p1:''%></label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               value="<%=data.p1?data.p1:''%>" disabled>
                    </div>

                    <label class="col-sm-2 control-label">时间</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               value="<%=data.p2?data.p2:''%>" >
                    </div>
                </div>
            </div>
            <div class="u-box ">
                <div class="u-box-header ">
                    <h3>客户信息</h3>
                </div>
                <div class="u-area">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">公司编号</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="p3"
                                   value="<%=data.p3?data.p3:''%>">
                        </div>

                        <label class="col-sm-2 control-label">客户公司名称</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="p4"
                                   value="<%=data.p4?data.p4:''%>">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">联系人</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="p5"
                                   value="<%=data.p5?data.p5:''%>">
                        </div>

                        <label class="col-sm-2 control-label">联系人电话</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="p6"
                                   value="<%=data.p6?data.p6:''%>">
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-box ">
                <div class="u-box-header ">
                    <h3>详细信息</h3>
                </div>
                <div class="u-area">
                    <div class="u-area">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">花工编号</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p7"
                                       value="<%=data.p7?data.p7:''%>">
                            </div>

                            <label class="col-sm-2 control-label">花工姓名</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p8"
                                       value="<%=data.p8?data.p8:''%>">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号1</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p9"
                                       value="<%=data.p9?data.p9:''%>">
                            </div>

                            <label class="col-sm-2 control-label">手机号2</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p10"
                                       value="<%=data.p10?data.p10:''%>">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">主管</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p11"
                                       value="<%=data.p11?data.p11:''%>">
                            </div>
                        </div>
                    </div>
                    <div class="u-area">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">花工用工小时</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p14"
                                       value="<%=data.p14?data.p14:''%>">
                            </div>
                            <label class="col-sm-2 control-label">花工用工金额</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="p15"
                                       value="<%=data.p15?data.p15:''%>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" name="p16"><%=data.p16?data.p16:''%></textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary pull-right">修改</button>
            </div>
        </form>
    </script>

<script>
    USEN(function () {
        //模块ID(全系统唯一)
        var tableId = "#zb_yewumingxi";
        var id = "#zb_yewumingxi_modify";

        //定义页面变量
        var $el = $(id);
        var $editor = $el.children('script[data-for=tp_editor]');

        $.ajax({
            url:"./simdata/common_modify_action.json",
            success:function(data){
                $el.children(".content").html(function(){
                    return _.template($editor.html())({
                        data:data
                    })
                });

                //提交表单
                $el.find("form").ajaxForm({
                    url: './simdata/common_modify_action.json',
                    beforeSubmit: function (data) {
                        //console.log("数据提交之前.")
                    },
                    success: function (data, state, obj) {
                        USEN.notifyAlert({
                            title: "提示:",
                            content: '操作成功,刷新列表'
                        });
                        USEN.getDatatable(tableId + ' table.table').ajax.reload();
                        USEN.closeActiveTab();
                    }
                })

                $el.find("select").css('width','98%').select2({
                    dropdownParent:$el
                });
                $el.find("input[data-plugin=date]").datepicker({
                    autoclose: true
                })
            }
        })

    });
</script>
</div>